package com.itheima.health.job;

import com.alibaba.dubbo.config.annotation.Reference;
<<<<<<< HEAD
import com.itheima.health.pojo.OrderSetting;
import com.itheima.health.service.OrderSettingService;
import com.itheima.health.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
=======
import com.itheima.health.service.OrderSettingService;
import java.text.SimpleDateFormat;
import java.util.Calendar;
>>>>>>> adc48831cde55357ef0420c5deac2882fa85ad7a

public class ClearOrderSettingJob {

    @Reference
    OrderSettingService orderSettingService;

    public void run() {
<<<<<<< HEAD
=======
        //获取上个月的最后一天
>>>>>>> adc48831cde55357ef0420c5deac2882fa85ad7a
        Calendar calendar = Calendar.getInstance();
        calendar.set(Calendar.DAY_OF_MONTH, 1);
        calendar.add(Calendar.DATE, -1);
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        String dateStr = sdf.format(calendar.getTime());
        orderSettingService.deleteOrderSettingByDate(dateStr);
<<<<<<< HEAD
=======
        System.out.println(123);
>>>>>>> adc48831cde55357ef0420c5deac2882fa85ad7a
    }
}
